package com.github.dapeng.soa;
        import com.github.dapeng.soa.info.serializer.*;

        import com.github.dapeng.core.*;
        import com.github.dapeng.org.apache.thrift.*;
        import com.github.dapeng.org.apache.thrift.protocol.*;

        import com.github.dapeng.core.definition.SoaServiceDefinition;
        import com.github.dapeng.core.definition.SoaFunctionDefinition;

        import java.io.BufferedReader;
        import java.io.InputStreamReader;

        import java.util.Optional;
        import java.util.concurrent.CompletableFuture;
        import java.util.concurrent.Future;

        import com.github.dapeng.soa.service.PrintServiceAsync;
        /**
        * Autogenerated by Dapeng-Code-Generator (1.2.2)
        *
        * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
        *  @generated
        **/
        public class PrintServiceAsyncCodec {

        
            public static class print_args {
            

            @Override
            public String toString(){
              StringBuilder stringBuilder = new StringBuilder("{");
                
                if(stringBuilder.lastIndexOf(",") > 0)
                stringBuilder.deleteCharAt(stringBuilder.lastIndexOf(","));
                stringBuilder.append("}");

              return stringBuilder.toString();
            }

          }

            public static class print_result {

            
                  @Override
                  public String toString(){
                  return "{}";
                }
                
          }

            public static class Print_argsSerializer implements BeanSerializer<print_args>{
            
      @Override
      public print_args read(TProtocol iprot) throws TException{

      print_args bean = new print_args();
      TField schemeField;
      iprot.readStructBegin();

      while(true){
        schemeField = iprot.readFieldBegin();
        if(schemeField.type == TType.STOP){ break;}

        switch(schemeField.id){
          
          
            default:
            TProtocolUtil.skip(iprot, schemeField.type);
          
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      validate(bean);
      return bean;
    }
    
      @Override
      public void write(print_args bean, TProtocol oprot) throws TException{

      validate(bean);
      oprot.writeStructBegin(new TStruct("print_args"));

      
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
    
      public void validate(print_args bean) throws TException{
      
    }
    

            @Override
            public String toString(print_args bean) { return bean == null ? "null" : bean.toString(); }

          }

            public static class Print_resultSerializer implements BeanSerializer<print_result>{
            @Override
            public print_result read(TProtocol iprot) throws TException{

              print_result bean = new print_result();
              TField schemeField;
              iprot.readStructBegin();

              while(true){
                schemeField = iprot.readFieldBegin();
                if(schemeField.type == TType.STOP){ break;}

                switch(schemeField.id){
                  case 0:  //SUCCESS
                  if(schemeField.type == TType.VOID){
                    
      TProtocolUtil.skip(iprot, schemeField.type);
                  }else{
                    TProtocolUtil.skip(iprot, schemeField.type);
                  }
                  break;
                  /*
                  case 1: //ERROR
                  bean.setSoaException(new SoaException());
                  new SoaExceptionSerializer().read(bean.getSoaException(),iprot);
                  break A;
                  */
                  default:
                  TProtocolUtil.skip(iprot, schemeField.type);
                }
                iprot.readFieldEnd();
              }
              iprot.readStructEnd();

              validate(bean);
              return bean;
            }
            
      @Override
      public void write(print_result bean, TProtocol oprot) throws TException{

      validate(bean);
      oprot.writeStructBegin(new TStruct("print_result"));

      
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
    
            
      public void validate(print_result bean) throws TException{
      
    }
    

            @Override
            public String toString(print_result bean) { return bean == null ? "null" : bean.toString(); }
          }

            public static class print<I extends PrintServiceAsync> extends SoaFunctionDefinition.Async<I, print_args, print_result>
            {
              public print()
              {
                super("print", new Print_argsSerializer(),  new Print_resultSerializer());
              }

              @Override
              public CompletableFuture<print_result> apply(PrintServiceAsync iface, print_args print_args) throws SoaException
              {

                CompletableFuture<Void> result = (CompletableFuture<Void>) iface.print( 50000);

                return result.thenApply((Void) -> {
                  print_result res = new print_result();
                  
                  return res;
              });
              }

            }
          
            public static class printInfo_args {
            
                private com.github.dapeng.soa.info.Info info;
                public com.github.dapeng.soa.info.Info getInfo(){
                return this.info;
              }
                public void setInfo(com.github.dapeng.soa.info.Info info){
                this.info = info;
              }
              

            @Override
            public String toString(){
              StringBuilder stringBuilder = new StringBuilder("{");
                
      stringBuilder.append("\"").append("info").append("\":").append(this.info == null ? "null" : this.info.toString()).append(",");
    
                if(stringBuilder.lastIndexOf(",") > 0)
                stringBuilder.deleteCharAt(stringBuilder.lastIndexOf(","));
                stringBuilder.append("}");

              return stringBuilder.toString();
            }

          }

            public static class printInfo_result {

            
                  private String success;
                  public String getSuccess(){
                  return success;
                }

                  public void setSuccess(String success){
                  this.success = success;
                }


                  @Override
                  public String toString(){
                  StringBuilder stringBuilder = new StringBuilder("{");
                    
      stringBuilder.append("\"").append("success").append("\":\"").append(success).append("\",");
    
                    stringBuilder.deleteCharAt(stringBuilder.lastIndexOf(","));
                    stringBuilder.append("}");

                  return stringBuilder.toString();
                }

                
          }

            public static class PrintInfo_argsSerializer implements BeanSerializer<printInfo_args>{
            
      @Override
      public printInfo_args read(TProtocol iprot) throws TException{

      printInfo_args bean = new printInfo_args();
      TField schemeField;
      iprot.readStructBegin();

      while(true){
        schemeField = iprot.readFieldBegin();
        if(schemeField.type == TType.STOP){ break;}

        switch(schemeField.id){
          
              case 1:
              if(schemeField.type == TType.STRUCT){
              com.github.dapeng.soa.info.Info elem0 = new com.github.dapeng.soa.info.Info();
        elem0=new InfoSerializer().read(iprot);
       bean.setInfo(elem0);
            }else{
              TProtocolUtil.skip(iprot, schemeField.type);
            }
              break;
            
          
            default:
            TProtocolUtil.skip(iprot, schemeField.type);
          
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      validate(bean);
      return bean;
    }
    
      @Override
      public void write(printInfo_args bean, TProtocol oprot) throws TException{

      validate(bean);
      oprot.writeStructBegin(new TStruct("printInfo_args"));

      
            oprot.writeFieldBegin(new TField("info", TType.STRUCT, (short) 1));
            com.github.dapeng.soa.info.Info elem0 = bean.getInfo();
             new InfoSerializer().write(elem0, oprot);
            
            oprot.writeFieldEnd();
          
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
    
      public void validate(printInfo_args bean) throws TException{
      
              if(bean.getInfo() == null)
              throw new SoaException(SoaBaseCode.NotNull, "info字段不允许为空");
            
                if(bean.getInfo() != null)
                new InfoSerializer().validate(bean.getInfo());
              
    }
    

            @Override
            public String toString(printInfo_args bean) { return bean == null ? "null" : bean.toString(); }

          }

            public static class PrintInfo_resultSerializer implements BeanSerializer<printInfo_result>{
            @Override
            public printInfo_result read(TProtocol iprot) throws TException{

              printInfo_result bean = new printInfo_result();
              TField schemeField;
              iprot.readStructBegin();

              while(true){
                schemeField = iprot.readFieldBegin();
                if(schemeField.type == TType.STOP){ break;}

                switch(schemeField.id){
                  case 0:  //SUCCESS
                  if(schemeField.type == TType.STRING){
                    String elem0 = iprot.readString();
       bean.setSuccess(elem0);
                  }else{
                    TProtocolUtil.skip(iprot, schemeField.type);
                  }
                  break;
                  /*
                  case 1: //ERROR
                  bean.setSoaException(new SoaException());
                  new SoaExceptionSerializer().read(bean.getSoaException(),iprot);
                  break A;
                  */
                  default:
                  TProtocolUtil.skip(iprot, schemeField.type);
                }
                iprot.readFieldEnd();
              }
              iprot.readStructEnd();

              validate(bean);
              return bean;
            }
            
      @Override
      public void write(printInfo_result bean, TProtocol oprot) throws TException{

      validate(bean);
      oprot.writeStructBegin(new TStruct("printInfo_result"));

      
            oprot.writeFieldBegin(new TField("success", TType.STRING, (short) 0));
            String elem0 = bean.getSuccess();
            oprot.writeString(elem0);
            
            oprot.writeFieldEnd();
          
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
    
            
      public void validate(printInfo_result bean) throws TException{
      
              if(bean.getSuccess() == null)
              throw new SoaException(SoaBaseCode.NotNull, "success字段不允许为空");
            
    }
    

            @Override
            public String toString(printInfo_result bean) { return bean == null ? "null" : bean.toString(); }
          }

            public static class printInfo<I extends PrintServiceAsync> extends SoaFunctionDefinition.Async<I, printInfo_args, printInfo_result>
            {
              public printInfo()
              {
                super("printInfo", new PrintInfo_argsSerializer(),  new PrintInfo_resultSerializer());
              }

              @Override
              public CompletableFuture<printInfo_result> apply(PrintServiceAsync iface, printInfo_args printInfo_args) throws SoaException
              {

                CompletableFuture<String> result = (CompletableFuture<String>) iface.printInfo(printInfo_args.info ,50000);

                return result.thenApply(( String i) -> {
                  printInfo_result res = new printInfo_result();
                  res.setSuccess(i);
                  return res;
              });
              }

            }
          
            public static class printInfo2_args {
            
                private String name;
                public String getName(){
                return this.name;
              }
                public void setName(String name){
                this.name = name;
              }
              

            @Override
            public String toString(){
              StringBuilder stringBuilder = new StringBuilder("{");
                
      stringBuilder.append("\"").append("name").append("\":\"").append(name).append("\",");
    
                if(stringBuilder.lastIndexOf(",") > 0)
                stringBuilder.deleteCharAt(stringBuilder.lastIndexOf(","));
                stringBuilder.append("}");

              return stringBuilder.toString();
            }

          }

            public static class printInfo2_result {

            
                  private String success;
                  public String getSuccess(){
                  return success;
                }

                  public void setSuccess(String success){
                  this.success = success;
                }


                  @Override
                  public String toString(){
                  StringBuilder stringBuilder = new StringBuilder("{");
                    
      stringBuilder.append("\"").append("success").append("\":\"").append(success).append("\",");
    
                    stringBuilder.deleteCharAt(stringBuilder.lastIndexOf(","));
                    stringBuilder.append("}");

                  return stringBuilder.toString();
                }

                
          }

            public static class PrintInfo2_argsSerializer implements BeanSerializer<printInfo2_args>{
            
      @Override
      public printInfo2_args read(TProtocol iprot) throws TException{

      printInfo2_args bean = new printInfo2_args();
      TField schemeField;
      iprot.readStructBegin();

      while(true){
        schemeField = iprot.readFieldBegin();
        if(schemeField.type == TType.STOP){ break;}

        switch(schemeField.id){
          
              case 1:
              if(schemeField.type == TType.STRING){
              String elem0 = iprot.readString();
       bean.setName(elem0);
            }else{
              TProtocolUtil.skip(iprot, schemeField.type);
            }
              break;
            
          
            default:
            TProtocolUtil.skip(iprot, schemeField.type);
          
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      validate(bean);
      return bean;
    }
    
      @Override
      public void write(printInfo2_args bean, TProtocol oprot) throws TException{

      validate(bean);
      oprot.writeStructBegin(new TStruct("printInfo2_args"));

      
            oprot.writeFieldBegin(new TField("name", TType.STRING, (short) 1));
            String elem0 = bean.getName();
            oprot.writeString(elem0);
            
            oprot.writeFieldEnd();
          
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
    
      public void validate(printInfo2_args bean) throws TException{
      
              if(bean.getName() == null)
              throw new SoaException(SoaBaseCode.NotNull, "name字段不允许为空");
            
    }
    

            @Override
            public String toString(printInfo2_args bean) { return bean == null ? "null" : bean.toString(); }

          }

            public static class PrintInfo2_resultSerializer implements BeanSerializer<printInfo2_result>{
            @Override
            public printInfo2_result read(TProtocol iprot) throws TException{

              printInfo2_result bean = new printInfo2_result();
              TField schemeField;
              iprot.readStructBegin();

              while(true){
                schemeField = iprot.readFieldBegin();
                if(schemeField.type == TType.STOP){ break;}

                switch(schemeField.id){
                  case 0:  //SUCCESS
                  if(schemeField.type == TType.STRING){
                    String elem0 = iprot.readString();
       bean.setSuccess(elem0);
                  }else{
                    TProtocolUtil.skip(iprot, schemeField.type);
                  }
                  break;
                  /*
                  case 1: //ERROR
                  bean.setSoaException(new SoaException());
                  new SoaExceptionSerializer().read(bean.getSoaException(),iprot);
                  break A;
                  */
                  default:
                  TProtocolUtil.skip(iprot, schemeField.type);
                }
                iprot.readFieldEnd();
              }
              iprot.readStructEnd();

              validate(bean);
              return bean;
            }
            
      @Override
      public void write(printInfo2_result bean, TProtocol oprot) throws TException{

      validate(bean);
      oprot.writeStructBegin(new TStruct("printInfo2_result"));

      
            oprot.writeFieldBegin(new TField("success", TType.STRING, (short) 0));
            String elem0 = bean.getSuccess();
            oprot.writeString(elem0);
            
            oprot.writeFieldEnd();
          
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
    
            
      public void validate(printInfo2_result bean) throws TException{
      
              if(bean.getSuccess() == null)
              throw new SoaException(SoaBaseCode.NotNull, "success字段不允许为空");
            
    }
    

            @Override
            public String toString(printInfo2_result bean) { return bean == null ? "null" : bean.toString(); }
          }

            public static class printInfo2<I extends PrintServiceAsync> extends SoaFunctionDefinition.Async<I, printInfo2_args, printInfo2_result>
            {
              public printInfo2()
              {
                super("printInfo2", new PrintInfo2_argsSerializer(),  new PrintInfo2_resultSerializer());
              }

              @Override
              public CompletableFuture<printInfo2_result> apply(PrintServiceAsync iface, printInfo2_args printInfo2_args) throws SoaException
              {

                CompletableFuture<String> result = (CompletableFuture<String>) iface.printInfo2(printInfo2_args.name ,50000);

                return result.thenApply(( String i) -> {
                  printInfo2_result res = new printInfo2_result();
                  res.setSuccess(i);
                  return res;
              });
              }

            }
          
            public static class printInfo3_args {
            
                private com.github.dapeng.soa.account.enums.AccountType accountType;
                public com.github.dapeng.soa.account.enums.AccountType getAccountType(){
                return this.accountType;
              }
                public void setAccountType(com.github.dapeng.soa.account.enums.AccountType accountType){
                this.accountType = accountType;
              }
              

            @Override
            public String toString(){
              StringBuilder stringBuilder = new StringBuilder("{");
                
      stringBuilder.append("\"").append("accountType").append("\":").append(accountType).append(",");
    
                if(stringBuilder.lastIndexOf(",") > 0)
                stringBuilder.deleteCharAt(stringBuilder.lastIndexOf(","));
                stringBuilder.append("}");

              return stringBuilder.toString();
            }

          }

            public static class printInfo3_result {

            
                  private String success;
                  public String getSuccess(){
                  return success;
                }

                  public void setSuccess(String success){
                  this.success = success;
                }


                  @Override
                  public String toString(){
                  StringBuilder stringBuilder = new StringBuilder("{");
                    
      stringBuilder.append("\"").append("success").append("\":\"").append(success).append("\",");
    
                    stringBuilder.deleteCharAt(stringBuilder.lastIndexOf(","));
                    stringBuilder.append("}");

                  return stringBuilder.toString();
                }

                
          }

            public static class PrintInfo3_argsSerializer implements BeanSerializer<printInfo3_args>{
            
      @Override
      public printInfo3_args read(TProtocol iprot) throws TException{

      printInfo3_args bean = new printInfo3_args();
      TField schemeField;
      iprot.readStructBegin();

      while(true){
        schemeField = iprot.readFieldBegin();
        if(schemeField.type == TType.STOP){ break;}

        switch(schemeField.id){
          
              case 1:
              if(schemeField.type == TType.I32){
              com.github.dapeng.soa.account.enums.AccountType elem0 = com.github.dapeng.soa.account.enums.AccountType.findByValue(iprot.readI32());
       bean.setAccountType(elem0);
            }else{
              TProtocolUtil.skip(iprot, schemeField.type);
            }
              break;
            
          
            default:
            TProtocolUtil.skip(iprot, schemeField.type);
          
        }
        iprot.readFieldEnd();
      }
      iprot.readStructEnd();

      validate(bean);
      return bean;
    }
    
      @Override
      public void write(printInfo3_args bean, TProtocol oprot) throws TException{

      validate(bean);
      oprot.writeStructBegin(new TStruct("printInfo3_args"));

      
            oprot.writeFieldBegin(new TField("accountType", TType.I32, (short) 1));
            com.github.dapeng.soa.account.enums.AccountType elem0 = bean.getAccountType();
            oprot.writeI32(elem0.getValue());
            
            oprot.writeFieldEnd();
          
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
    
      public void validate(printInfo3_args bean) throws TException{
      
              if(bean.getAccountType() == null)
              throw new SoaException(SoaBaseCode.NotNull, "accountType字段不允许为空");
            
    }
    

            @Override
            public String toString(printInfo3_args bean) { return bean == null ? "null" : bean.toString(); }

          }

            public static class PrintInfo3_resultSerializer implements BeanSerializer<printInfo3_result>{
            @Override
            public printInfo3_result read(TProtocol iprot) throws TException{

              printInfo3_result bean = new printInfo3_result();
              TField schemeField;
              iprot.readStructBegin();

              while(true){
                schemeField = iprot.readFieldBegin();
                if(schemeField.type == TType.STOP){ break;}

                switch(schemeField.id){
                  case 0:  //SUCCESS
                  if(schemeField.type == TType.STRING){
                    String elem0 = iprot.readString();
       bean.setSuccess(elem0);
                  }else{
                    TProtocolUtil.skip(iprot, schemeField.type);
                  }
                  break;
                  /*
                  case 1: //ERROR
                  bean.setSoaException(new SoaException());
                  new SoaExceptionSerializer().read(bean.getSoaException(),iprot);
                  break A;
                  */
                  default:
                  TProtocolUtil.skip(iprot, schemeField.type);
                }
                iprot.readFieldEnd();
              }
              iprot.readStructEnd();

              validate(bean);
              return bean;
            }
            
      @Override
      public void write(printInfo3_result bean, TProtocol oprot) throws TException{

      validate(bean);
      oprot.writeStructBegin(new TStruct("printInfo3_result"));

      
            oprot.writeFieldBegin(new TField("success", TType.STRING, (short) 0));
            String elem0 = bean.getSuccess();
            oprot.writeString(elem0);
            
            oprot.writeFieldEnd();
          
      oprot.writeFieldStop();
      oprot.writeStructEnd();
    }
    
            
      public void validate(printInfo3_result bean) throws TException{
      
              if(bean.getSuccess() == null)
              throw new SoaException(SoaBaseCode.NotNull, "success字段不允许为空");
            
    }
    

            @Override
            public String toString(printInfo3_result bean) { return bean == null ? "null" : bean.toString(); }
          }

            public static class printInfo3<I extends PrintServiceAsync> extends SoaFunctionDefinition.Async<I, printInfo3_args, printInfo3_result>
            {
              public printInfo3()
              {
                super("printInfo3", new PrintInfo3_argsSerializer(),  new PrintInfo3_resultSerializer());
              }

              @Override
              public CompletableFuture<printInfo3_result> apply(PrintServiceAsync iface, printInfo3_args printInfo3_args) throws SoaException
              {

                CompletableFuture<String> result = (CompletableFuture<String>) iface.printInfo3(printInfo3_args.accountType ,50000);

                return result.thenApply(( String i) -> {
                  printInfo3_result res = new printInfo3_result();
                  res.setSuccess(i);
                  return res;
              });
              }

            }
          

        public static class getServiceMetadata_args {

          @Override
          public String toString() {
            return "{}";
          }
        }


        public static class getServiceMetadata_result {

          private String success;

          public String getSuccess() {
            return success;
          }

          public void setSuccess(String success) {
            this.success = success;
          }

          @Override
          public String toString() {
            StringBuilder stringBuilder = new StringBuilder("{");
              stringBuilder.append("\"").append("success").append("\":\"").append(this.success).append("\",");
              stringBuilder.deleteCharAt(stringBuilder.lastIndexOf(","));
              stringBuilder.append("}");

            return stringBuilder.toString();
          }
        }

        public static class GetServiceMetadata_argsSerializer implements BeanSerializer<getServiceMetadata_args> {

          @Override
          public getServiceMetadata_args read(TProtocol iprot) throws TException {

            getServiceMetadata_args bean =new getServiceMetadata_args();
            TField schemeField;
            iprot.readStructBegin();

            while (true) {
              schemeField = iprot.readFieldBegin();
              if (schemeField.type == TType.STOP) {
                break;
              }
              switch (schemeField.id) {
                default:
                TProtocolUtil.skip(iprot, schemeField.type);

              }
              iprot.readFieldEnd();
            }
            iprot.readStructEnd();

            validate(bean);
            return bean;
          }


          @Override
          public void write(getServiceMetadata_args bean, TProtocol oprot) throws TException {

            validate(bean);
            oprot.writeStructBegin(new TStruct("getServiceMetadata_args"));
            oprot.writeFieldStop();
            oprot.writeStructEnd();
          }

          public void validate(getServiceMetadata_args bean) throws TException {}

          @Override
          public String toString(getServiceMetadata_args bean) {
            return bean == null ? "null" : bean.toString();
          }

        }

        public static class GetServiceMetadata_resultSerializer implements BeanSerializer<getServiceMetadata_result> {
          @Override
          public getServiceMetadata_result read(TProtocol iprot) throws TException {

            getServiceMetadata_result bean = new getServiceMetadata_result();
            TField schemeField;
            iprot.readStructBegin();

            while (true) {
              schemeField = iprot.readFieldBegin();
              if (schemeField.type == TType.STOP) {
                break;
              }

              switch (schemeField.id) {
                case 0:  //SUCCESS
                if (schemeField.type == TType.STRING) {
                  bean.setSuccess(iprot.readString());
                } else {
                  TProtocolUtil.skip(iprot, schemeField.type);
                }
                break;
                default:
                TProtocolUtil.skip(iprot, schemeField.type);
              }
              iprot.readFieldEnd();
            }
            iprot.readStructEnd();

            validate(bean);
            return bean;
          }

          @Override
          public void write(getServiceMetadata_result bean, TProtocol oprot) throws TException {

            validate(bean);
            oprot.writeStructBegin(new TStruct("getServiceMetadata_result"));

            oprot.writeFieldBegin(new TField("success", TType.STRING, (short) 0));
            oprot.writeString(bean.getSuccess());
            oprot.writeFieldEnd();

            oprot.writeFieldStop();
            oprot.writeStructEnd();
          }

          public void validate(getServiceMetadata_result bean) throws TException {

            if (bean.getSuccess() == null)
            throw new SoaException(SoaBaseCode.NotNull, "success字段不允许为空");
          }

          @Override
          public String toString(getServiceMetadata_result bean) {
            return bean == null ? "null" : bean.toString();
          }
        }

        public static class getServiceMetadata<I extends com.github.dapeng.soa.service.PrintService> extends SoaFunctionDefinition.Sync<I, getServiceMetadata_args, getServiceMetadata_result> {
          public getServiceMetadata() {
            super("getServiceMetadata", new GetServiceMetadata_argsSerializer(), new GetServiceMetadata_resultSerializer());
          }

          @Override
          public getServiceMetadata_result apply(I iface, getServiceMetadata_args args) {
            getServiceMetadata_result result = new getServiceMetadata_result();

            try (InputStreamReader isr = new InputStreamReader(PrintServiceCodec.class.getClassLoader().getResourceAsStream("com.github.dapeng.soa.service.PrintService.xml"));
            BufferedReader in = new BufferedReader(isr)) {
              int len = 0;
              StringBuilder str = new StringBuilder("");
              String line;
              while ((line = in.readLine()) != null) {

                if (len != 0) {
                  str.append("\r\n").append(line);
                } else {
                  str.append(line);
                }
                len++;
              }
              result.success = str.toString();

            } catch (Exception e) {
              e.printStackTrace();
              result.success = "";
            }

            return result;
          }

        }

        @SuppressWarnings("unchecked")
        public static class Processor<I extends PrintServiceAsync> extends SoaServiceDefinition<PrintServiceAsync>
        {

          public Processor(PrintServiceAsync iface, Class<PrintServiceAsync> ifaceClass)
          {
            super(iface, ifaceClass, buildMap(new java.util.HashMap<>()));
          }

          @SuppressWarnings("unchecked")
          private static <I extends PrintServiceAsync> java.util.Map<String, SoaFunctionDefinition<I, ?, ?>> buildMap(java.util.Map<String, SoaFunctionDefinition<I, ?, ?>> processMap)
          {
            
                processMap.put("print", new print());
              
                processMap.put("printInfo", new printInfo());
              
                processMap.put("printInfo2", new printInfo2());
              
                processMap.put("printInfo3", new printInfo3());
              
            processMap.put("getServiceMetadata", new getServiceMetadata());
            return processMap;
          }
        }

      }
      